package com.rd.student.dashuju.sunwenzhuo.Test1.drinktasting;

public abstract class Drink {
    public abstract void taste();

    public static final int COFFEE = 0;
    public static final int BEER = 1;
    public static final int MILK = 2;

    public static Drink getInstance(int drinkType) {


        switch (drinkType) {
            case 0:
                return new Coffee();
            case 1:
                return new Beer();
            case 2:
                return new Milk();
            default:
                return null;
        }
    }
}
